<?php /* Smarty version 2.6.18, created on 2016-12-12 22:22:39
         compiled from absent/absent.list.tpl.php */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.header.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.left.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
  <!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
        <section class="col-lg-12 connectedSortable">
         <div class="box box-default box-solid">
                <div class="box-header with-border">
                    <span class="fa fa-list" style="float:left; font-size:18px; margin-top:2px; color:#3c8dbc;" ></span>
                    <p class="box-title">代课明细列表</p>
                </div>
                    <div class="box-body">
                    	<form action="" method="get">
                            <div class="col-md-3 form-group">
                                <label for="inputPassword3" class="col-sm-4 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500; margin:0;">
                                    学年学期：
                                </label>
                                <div class="input-group col-md-8 col-xs-12">
                                    <select class="form-control" name="semester_id" id="semester_id">
                                        <option value="">请选择</option>
                                        <?php $_from = $this->_tpl_vars['semester_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
                                        <option value="<?php echo $this->_tpl_vars['value']['semester_id']; ?>
"<?php if ($this->_tpl_vars['value']['semester_id'] == $this->_tpl_vars['semester_id']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['value']['semester_xname']; ?>
<?php echo $this->_tpl_vars['value']['semester_name']; ?>
</option>
                                        <?php endforeach; endif; unset($_from); ?>
                                    </select>
                                </div>
                            </div>
                            <div class="col-md-3 form-group">
                                <label for="inputPassword3" class="col-sm-4 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500; margin:0;">
                                    月份：
                                </label>
                                <div class="input-group col-md-8 col-xs-12">
                                    <select class="form-control" id="semester_month" name="month_id">
                                    </select>
                                </div>
                            </div>
                            <input type="hidden" name="a" value="absent.list">
                            <button type="submit" class="btn btn-warning">查 询</button>
                        </form>
                       <table class="table table-bordered table-striped" id="mytable">
                          <thead>   
                             <tr style=" background-color:#5fb2dc;">
							    <td>班级</td>
								<td>原学科</td>
								<td>星期几</td>
								<td>开始日期</td>
								<td>结束日期</td>
								<td>节次</td>
								<td>原科任</td>
								<td>原因</td>
								<td>代理学科</td>
								<td>代理教师</td>
								<td>录入时间</td>
							 </tr>
                         </thead>
							 <?php $_from = $this->_tpl_vars['absent_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
                             <tr>
							    <td><?php echo $this->_tpl_vars['value']['class_name']; ?>
</td>
								<td><?php echo $this->_tpl_vars['value']['from_subjectname']; ?>
</td>
								<td><?php echo $this->_tpl_vars['value']['absent_week']; ?>
</td>
								<td><?php echo $this->_tpl_vars['value']['start_time']; ?>
</td>
								<td><?php echo $this->_tpl_vars['value']['end_time']; ?>
</td>
								<td><?php echo $this->_tpl_vars['value']['absent_section']; ?>
</td>
								<td><?php echo $this->_tpl_vars['value']['from_staffname']; ?>
</td>
								<td><?php echo $this->_tpl_vars['value']['absent_itemname']; ?>
</td>
								<td><?php echo $this->_tpl_vars['value']['to_subjectname']; ?>
</td>
								<td><?php echo $this->_tpl_vars['value']['to_staffname']; ?>
</td>
								<td><?php echo $this->_tpl_vars['value']['create_time']; ?>
</td>
							 </tr>
							 <?php endforeach; endif; unset($_from); ?>
						 </table> 
						 <?php echo $this->_tpl_vars['page']; ?>

				    </div><!--box-body --> 
             </div><!--box box-default box-solid-->
          </section>   
        </div><!--row-->
    </section>
 </div>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.footer.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<script type="text/javascript">
	$(document).ready(function () {
		$("#semester_id").change(function () {
			if ($(this).val() == "-1") {
				$("#industr").remove(); return;
			}
			else {
				var timestamp = new Date().getTime();
				$.ajax({
					url:"index.php?a=semester.MonthJson",
					type:"get",
					data: "semester_id=" + $("#semester_id").find("option:selected").val() + "&timestamp=" + timestamp,
					dataType:"json",
					success:function(msg){

						//实例2个字符串变量来拼接下拉列表
						var industr = "";
						//使用jquery解析json中的数据
						$.each(msg, function (n, value) {
							industr += ("<option value=\"" + value.semester_month + "\">" + value.semester_month);
							industr += ("</option>");
						});

						$("#semester_month").html(industr);
					}
				});

			}

		});

	});
</script>